/**
 * 
 * @author Sunix
 * @date   2013-5-26
 * @Email  SunixSky@gmail.com
 * 
 */	
package business.scene{
	import flash.display.Bitmap;
	
	import br.com.stimuli.loading.BulkLoader;
	import br.com.stimuli.loading.BulkProgressEvent;
	
	import core.General;
	import core.Layer;
	
	
	
	
	public class SceneManager{
		
		protected static var self:SceneManager;     //播放器管理器实例
		
		private var _loader:BulkLoader;
		
		public function SceneManager(single:Single){
			
		}
		
		public function loadScene():void{
			loader.add('assets/image/scene/BackGround.jpg',{'id':'bg'});
			loader.addEventListener(BulkLoader.COMPLETE,onComplete);
			loader.start();
			
		}
		
		protected function onComplete(event:BulkProgressEvent):void{
			var bm:Bitmap = loader.getBitmap("bg");
			Layer.mapLayer.addChild(bm);
			
		}
		
		/**
		 * 获取单例
		 *  
		 * @return 
		 * 
		 */		
		public static function get instance():SceneManager{
			if(!self)
				self = new SceneManager(new Single());
			return self;
		}

		public function get loader():BulkLoader{
			if(!_loader)
				_loader = General.loader;
			return _loader;
		}

	}
}

class Single{}